Socket
Socket
Sign inDemoInstall

bmp-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bmp-js

A pure javascript BMP encoder and decoder


Version published
Weekly downloads
1.4M
increased by1.61%
Maintainers
1
Weekly downloads
 
Created

What is bmp-js?

The bmp-js npm package is a JavaScript library for encoding and decoding BMP (Bitmap) image files. It allows you to read BMP files, manipulate their data, and write BMP files. This can be useful for applications that need to handle BMP images directly, such as image processing tools, graphic editors, or any application that needs to work with BMP files.

What are bmp-js's main functionalities?

Decode BMP

This feature allows you to decode a BMP file into a JavaScript object. The object contains information about the BMP file, such as width, height, and pixel data.

const bmp = require('bmp-js');
const fs = require('fs');

const bmpBuffer = fs.readFileSync('path/to/your/image.bmp');
const bmpData = bmp.decode(bmpBuffer);
console.log(bmpData);

Encode BMP

This feature allows you to encode a JavaScript object into a BMP file. You can specify the pixel data, width, and height of the image, and then write the encoded BMP data to a file.

const bmp = require('bmp-js');
const fs = require('fs');

const bmpData = {
  data: Buffer.from([/* pixel data */]),
  width: 100,
  height: 100
};
const rawData = bmp.encode(bmpData);
fs.writeFileSync('path/to/your/output.bmp', rawData.data);

Other packages similar to bmp-js

Keywords

FAQs

Package last updated on 23 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc